require("lualib_bundle");
__TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["4"] = 2,["5"] = 2,["6"] = 2,["8"] = 2,["9"] = 5,["10"] = 6,["11"] = 5,["12"] = 9,["13"] = 10,["14"] = 9,["15"] = 14,["16"] = 15,["17"] = 16,["18"] = 17,["20"] = 19,["21"] = 20,["22"] = 21,["23"] = 22,["24"] = 23,["25"] = 24,["28"] = 27,["29"] = 14,["30"] = 37,["31"] = 38,["32"] = 37,["33"] = 2});
local ____exports = {}
____exports.default = __TS__Class()
local RandomUtil = ____exports.default
RandomUtil.name = "RandomUtil"
function RandomUtil.prototype.____constructor(self)
end
function RandomUtil.nextInt(min, max)
    return GetRandomInt(min, max)
end
function RandomUtil.nextReal(min, max)
    return GetRandomReal(min, max)
end
function RandomUtil.getRandomKeyByWeight(objAndWeight)
    local max = 0
    for objAndWeightKey in pairs(objAndWeight) do
        max = max + objAndWeight[objAndWeightKey]
    end
    local ri = ____exports.default.nextReal(0, max)
    max = 0
    for objAndWeightKey in pairs(objAndWeight) do
        max = max + objAndWeight[objAndWeightKey]
        if ri <= max then
            return objAndWeightKey
        end
    end
    return nil
end
function RandomUtil.isInChance(chance)
    return GetRandomReal(0, 1) < chance
end
____exports.default = RandomUtil
return ____exports
